﻿<UserControl x:Class="SMS.Views.Admin.DeActivateUser"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:my="clr-namespace:SMS.Controls;assembly=SMS.Controls"
             xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"
    >
    
    <Grid x:Name="LayoutRoot" Background="White">
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition></RowDefinition>
                <RowDefinition Height="30"></RowDefinition>
                <RowDefinition Height="auto"></RowDefinition>
            </Grid.RowDefinitions>
            <sdk:TabControl SelectedIndex="{Binding SelectedTabIndex, Mode=TwoWay}">
                <sdk:TabItem Header="Activate / De-Activate User">
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition/>
                            <RowDefinition Height="auto"/>
                        </Grid.RowDefinitions>
                        <Grid HorizontalAlignment="Left" VerticalAlignment="Top" Margin="10" Grid.Row="0" Width="400">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="auto"/>
                                <RowDefinition Height="auto"/>
                                <RowDefinition Height="auto"/>
                                <RowDefinition Height="auto"/>
                            </Grid.RowDefinitions>

                            <!--<TextBlock Grid.Row="0" HorizontalAlignment="Left" Text="Activate / De-Activate User" FontSize="15" FontWeight="Bold" VerticalAlignment="Bottom" Margin="10,5,0,13"></TextBlock>-->
                            <TextBlock Grid.Row="1" HorizontalAlignment="Left" Text="Select User" VerticalAlignment="Bottom" Margin="10,0,0,18"></TextBlock>
                            <my:SMSUsers SelectedUser="{Binding SelectedUser, Mode=TwoWay}" Margin="130,10,10,15" Grid.Row="1" VerticalAlignment="Center"></my:SMSUsers>
                            <RadioButton Content="Activate User" IsChecked="{Binding ActivateUser, Mode=TwoWay}" GroupName="User" FlowDirection="RightToLeft"  HorizontalAlignment="Right" Grid.Row="2" Margin="10,0,150,0"></RadioButton>
                            <RadioButton Content="De-Activate User" IsChecked="{Binding DeActivateUser, Mode=TwoWay}"  GroupName="User" FlowDirection="RightToLeft" HorizontalAlignment="Right" Grid.Row="2" Margin="0,0,10,0"></RadioButton>
                            
                        </Grid>
                        
                    </Grid>
                </sdk:TabItem>
                <sdk:TabItem Header="Manage User Role">
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition/>
                            <RowDefinition Height="auto"/>
                        </Grid.RowDefinitions>
                        <Grid HorizontalAlignment="Left" VerticalAlignment="Top" Margin="10" Grid.Row="0" Width="400">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="auto"/>
                                <RowDefinition Height="auto"/>
                                <RowDefinition Height="auto"/>
                                <RowDefinition Height="auto"/>
                            </Grid.RowDefinitions>
                            
                            <TextBlock Grid.Row="0" HorizontalAlignment="Left" Text="Select User" VerticalAlignment="Bottom" Margin="10,0,0,18"></TextBlock>
                            <my:SMSUsers SelectedUser="{Binding SelectedUser, Mode=TwoWay}" Margin="150,10,10,15" Grid.Row="0" VerticalAlignment="Center"></my:SMSUsers>
                            <TextBlock Grid.Row="1" HorizontalAlignment="Left" Text="Select Access Role" VerticalAlignment="Bottom" Margin="10,0,0,18"></TextBlock>
                            <ComboBox SelectedItem="{Binding SelectedUserRole, Mode=TwoWay}"  ItemsSource="{Binding AccessRoleList}" Margin="150,10,10,15" Grid.Row="1" VerticalAlignment="Center">                                
                                <ComboBox.ItemTemplate>
                                    <DataTemplate>
                                        <StackPanel Orientation="Horizontal">
                                            <TextBlock Text="{Binding RoleValue}"></TextBlock>
                                            <TextBlock Text=" : "></TextBlock>
                                            <TextBlock Text="{Binding RoleName}"></TextBlock>
                                        </StackPanel>                                    
                                    </DataTemplate>
                                </ComboBox.ItemTemplate>
                            </ComboBox>

                        </Grid>

                    </Grid>
                </sdk:TabItem>
            </sdk:TabControl>
            <Grid Grid.Row="1">
                <Button Command="{Binding ActivateDeActivateUserCommand}" Content="Save" HorizontalAlignment="Right" Width="100" Margin="0,0,106,0"></Button>
                <Button Command="{Binding CancelCommand}" Content="Cancel"  HorizontalAlignment="Right" Width="100" ></Button>
            </Grid>
            <Grid Grid.Row="2">
                <my:ErrorControl HorizontalAlignment="Left"
                             Name="errorControl1"
                             VerticalAlignment="Top" />
            </Grid>
        </Grid>
        
    </Grid>
</UserControl>
